/*
 * @Author: kanglang
 * @Date: 2020-11-23 11:38:07
 * @LastEditors: kanglang
 * @LastEditTime: 2021-06-08 18:18:12
 * @Description: 三方登录方式
 */
import React from 'react';
import { StyleSheet, Text, TouchableOpacity } from 'react-native';
import { px2dp } from '@/styles';

const LoginBtn = ({
  submit,
  disabled = false,
  btnStyle,
  btnText = '登录'
}) => {
  const handleMeth = () => {
    submit && submit();
  };
  return (
    <TouchableOpacity
      disabled={disabled}
      style={[styles.btnStyle, btnStyle, !disabled ? styles.active : styles.notActive]}
      onPress={handleMeth}
    >
      <Text style={styles.loginText}>{btnText}</Text>
    </TouchableOpacity>
  );
};
export default LoginBtn;

const styles = StyleSheet.create({
  btnStyle: {
    justifyContent: 'center',
    alignItems: 'center',
    paddingVertical: px2dp(22),
    width: px2dp(640),
    marginTop: 40,
    borderRadius: px2dp(50)
  },
  notActive: {
    opacity: 0.5,
    backgroundColor: '#BA914A'
  },
  active: {
    backgroundColor: '#BA914A'
  },
  loginText: {
    textAlign: 'center',
    color: 'white',
    textAlignVertical: 'center',
    fontSize: px2dp(36)
  },
});
